<%@ page language="java"  pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
  <jsp:include page="/head.html" flush="true"></jsp:include>
  
  <body>
   

     <div class="x-body" >
        <form class="layui-form" action="proupdatesc.jsp" method="post">
           <div class="layui-form-item">
              <label for="L_professorName" class="layui-form-label">
                  <span class="x-red">*</span>专家编号
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_id" name="id" required lay-verify="professorName" value="${p.id}"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          
        
          <div class="layui-form-item">
              <label for="L_professorName" class="layui-form-label">
                  <span class="x-red">*</span>专家名称
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_professorName" name="professorName" required lay-verify="professorName" value="${p.professorName}"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="L_gender" class="layui-form-label">
                  <span class="x-red">*</span>性别：
              </label>
              <div class="layui-input-inline">
              	  <input type="radio"  name="gender" value="男" class="layui-input" title="男"/>
              	  <input type="radio" name="gender" value="女" class="layui-input" title="女"/>
                  
              </div>
          </div>
          
           <div class="layui-form-item">
              <label for="L_birthday" class="layui-form-label">
                  <span class="x-red">*</span>出生日期：
              </label>
              <div class="layui-input-inline">
                  <input type="date" id="L_birthday" name="birthday" required lay-verify="birthday" value="${p.birthday}"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          
          
            <div class="layui-form-item">
              <label for="L_identityNumber" class="layui-form-label">
                  <span class="x-red">*</span>身份证号：
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_identityNumber" name="identityNumber" required  lay-verify="identityNumber" value="${p.identityNumber}"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          
           <div class="layui-form-item">
              <label for="L_workStatus" class="layui-form-label">
                  <span class="x-red">*</span>工作状况：
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_idcrad" name="workStatus" required  lay-verify="workStatus" value="${p.workStatus}"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="L_institution" class="layui-form-label">
                  <span class="x-red">*</span>毕业院校：
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_institution" name="institution" required lay-verify="institution" value="${p.institution}"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          
          
          <div class="layui-form-item">
              <label for="L_education" class="layui-form-label">
                  <span class="x-red">*</span>学历：
              </label>
              <div class="layui-input-inline">
                 <select id="education" name="education" class="layui-form-select">
                 	 <option  value="小学">小学</option>
	                 <option  value="初中">初中</option>
	                 <option  value="高中">高中</option>
	                 <option  value="专科">专科</option>
	                 <option  value="本科">本科</option>
	                 <option  value="硕士">硕士</option>
	                 <option  value="博士">博士</option> 
                 </select>
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="L_major" class="layui-form-label">
                  <span class="x-red">*</span>所学专业：
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_major" name="major" required lay-verify="major" value="${p.major}"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="L_employCompany" class="layui-form-label">
                  <span class="x-red">*</span>工作单位：
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_employCompany" name="employCompany" required lay-verify="employCompany" value="${p.employCompany}"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="L_technicalPost" class="layui-form-label">
                  <span class="x-red">*</span>技术职称：
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_technicalPost" name="technicalPost" required lay-verify="technicalPost  "   value="${p.technicalPost}"           
                    autocomplete="off" class="layui-input">
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="L_phone" class="layui-form-label">
                  <span class="x-red">*</span>固定电话：
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_phone1" name="phone" required lay-verify="phone"  value="${p.phone}"            
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          
          
          <div class="layui-form-item">
              <label for="L_administrative" class="layui-form-label">
                  <span class="x-red">*</span>行政职务：
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_administrative" name="administrative" required lay-verify="administrative" value="${p.administrative}"    
                                autocomplete="off" class="layui-input">
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="L_mobliePhone" class="layui-form-label">
                  <span class="x-red">*</span>移动电话：
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_mobliePhone" name="mobliePhone" required lay-verify="mobliePhone" value="${p.mobliePhone}"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          
          
          <div class="layui-form-item">
              <label for="L_address" class="layui-form-label">
                  <span class="x-red">*</span>所在地址：
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_address" name="address" required lay-verify="address" value="${p.address}"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="L_projectCategory" class="layui-form-label">
                  <span class="x-red">*</span>参加评审项目的类型的id：
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_projectCategory" name="projectCategory" required lay-verify="projectCategory"  value="${p.projectCategory}"
                  
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="L_createBy" class="layui-form-label">
                  <span class="x-red">*</span>创建者用户名：
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_createBy" name="createBy" required lay-verify="createBy" value="${p.createBy}"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          
          
          <div class="layui-form-item">
              <label for="L_createDate" class="layui-form-label">
                  <span class="x-red">*</span>创建时间：
              </label>
              <div class="layui-input-inline">
                  <input type="date" id="L_createDate" name="createDate" required lay-verify="createDate" value="${p.createDate}"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="L_modifyBy" class="layui-form-label">
                  <span class="x-red">*</span>执行最后一次修改的用户：
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_modifyBy" name="modifyBy" required lay-verify="modifyBy" value="${p.modifyBy}"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="L_modifyDate" class="layui-form-label">
                  <span class="x-red">*</span>最后一次修改的时间：
              </label>
              <div class="layui-input-inline">
                  <input type="date" id="L_modifyDate" name="modifyDate" required lay-verify="modifyDate" value="${p.modifyDate}"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          
           <div class="layui-form-item">
              <label for="L_workDate" class="layui-form-label">
                  <span class="x-red">*</span>专家工作的年限：
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_workDate" name="workDate" required lay-verify="workDate" value="${p.workDate}"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          
           <div class="layui-form-item">
              <label for="L_lostNum" class="layui-form-label">
                  <span class="x-red">*</span>专家连续未参加评标的次数：
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_lostNum" name="lostNum" required lay-verify="lostNum" value="${p.lostNum}"
                  autocomplete="off" class="layui-input">
              </div>
          </div> 
          
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              </label>
              <button  class="layui-btn" lay-filter="add" lay-submit="">
                  修改
              </button>
          </div>
      </form>
    </div>
    <script>
      layui.use(['form','layer'], function(){
            $ = layui.jquery;
          var form = layui.form
          ,layer = layui.layer;
         /* var laydate=layui.laydate;
         laydate.render({elem:"#L_birthday"});
          
         laydate.render({elem:"#L_modifyDate"})
         laydate.render({elem:"#L_createDate"}); */
         $(":radio[name='gender'][value='${p.gender}']").attr("checked",true);
         
        $("#education").find("option[value='${p.education}']").prop("selected",true);
		form.render();
 
        //自定义验证规则
        form.verify({
          nikename: function(value){
            if(value.length < 5){
              return '昵称至少得5个字符啊';
            }
          }
          ,pass: [/(.+){6,12}$/, '密码必须6到12位']
          ,repass: function(value){
              if($('#L_pass').val()!=$('#L_repass').val()){
                  return '两次密码不一致';
              }
          }
        });

        //监听提交
        form.on('submit(add)', function(data){
          //console.log(data);
          //发异步
          $.post("professorUpdateServlet",$(".layui-form").serialize(),function(data){
          	alert(data);
          	 layer.alert("修改成功", {icon: 6},function () {
              // 获得frame索引
              var index = parent.layer.getFrameIndex(window.name);
              //关闭当前frame
              parent.layer.close(index);
              parent.location.reload();
          }); 
          
          });
          
        
          return false;//!!!!!!!
        });
        
        
      });
  </script>
  
  </body>

</html>
